imgSrcBase="img"


function drOnMouseOverBtn(r)	{
   obj=window.losBotones[r]
	document.getElementById(obj.id+'_B1').src=imgSrcBase+'/drbtn1S.gif'
	document.getElementById(obj.id+'_B3').src=imgSrcBase+'/drbtn3S.gif'	
	document.getElementById(obj.id+'_B2').className='drTextoBotonRollOver'
	if (obj.iconoS)	{
		document.getElementById(obj.id+'_BICO').src=obj.iconoS
		document.getElementById(obj.id+'_BICOTD').className='drTextoBotonRollOver'
		}
	}
	
function drOnMouseOutBtn(r)	{
   obj=window.losBotones[r]
	document.getElementById(obj.id+'_B1').src=imgSrcBase+'/drbtn1N.gif'
	document.getElementById(obj.id+'_B3').src=imgSrcBase+'/drbtn3N.gif'	
	document.getElementById(obj.id+'_B2').className='drTextoBoton'	
	if (obj.iconoN)	{
		document.getElementById(obj.id+'_BICO').src=obj.iconoN
		document.getElementById(obj.id+'_BICOTD').className='drTextoBoton'
		}		
	}
		
function drOnMouseDownBtnModal(r)   {
   window.returnValue=losBotones[r].retorna
   close();
   }
   
function drOnMouseDownBtn(r)   {
	eval(losBotones[r].js)
   close();
   }   

function registraIdBotones(losBotones) {
   for (var r=0;r<losBotones.length;r++)
      losBotones[r].id="IDBTN"+r
   }   
   

   
function generaHtmlBotones(losBotones) {
   html=[]
   html[html.length]="	 	<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
   html[html.length]="        <tr>";
   for (var r=0;r<losBotones.length;r++)  {
      var elbtn=losBotones[r]
      if (r>0)
         html[html.length]="          <td width=\"8\">&nbsp;</td>";
      html[html.length]="          <td>";
      
		if (losBotones[r].retorna != null)      
	      html[html.length]="             <a class=drABtn href=javascript:void(null) onkeydown=if(event.keyCode==13)drOnMouseDownBtnModal(" + r + ") onmousedown=drOnMouseDownBtnModal("+r+")>";
		else if (losBotones[r].js !=null)	      
		   html[html.length]="             <a class=drABtn href=javascript:void(null) onkeydown=if(event.keyCode==13)drOnMouseDownBtn(" + r + ") onmousedown=drOnMouseDownBtn("+r+")>";		
		else
			html[html.length]="             <a class=drABtn href=javascript:void(null)>";		
      html[html.length]="                <table border=\"0\"  cellpadding=\"0\" cellspacing=\"0\" onmouseover=\"drOnMouseOverBtn("+r+")\" onmouseout=\"drOnMouseOutBtn("+r+")\">";
      html[html.length]="                  <tr>";
      html[html.length]="                    <td ><img id=\""+elbtn.id+"_B1\" src=\""+imgSrcBase+"/drbtn1N.gif\" ></td>";
      if (elbtn.iconoN!=null)
         html[html.length]="                    <td id=\""+elbtn.id+"_BICOTD\" class=\"drTextoBoton\" ><img id=\""+elbtn.id+"_BICO\" src=\""+elbtn.iconoN+"\" ></td>";
      html[html.length]="                    <td id=\""+elbtn.id+"_B2\" class=\"drTextoBoton\" style=\"padding-right:5px;padding-left:5px;\">"+elbtn.texto+"</td>";
      html[html.length]="                    <td ><img id=\""+elbtn.id+"_B3\" src=\""+imgSrcBase+"/drbtn3N.gif\"></td>";
      html[html.length]="                  </tr>";
      html[html.length]="                </table>";
      html[html.length]="             </a>";
      html[html.length]="          </td>";
      }
   html[html.length]="        </tr>";
   html[html.length]="      </table>";
   return html.join('')
   }      

function precargaImgs(arrImgs)   	{
	var aa=[]
	for (var r=0;r<arrImgs.length;r++)  {
		aa[r]=new Image()
		aa[r].src=arrImgs[r]
		}
	}
	
	